package com.tianyi.sfzy1.controller;

import com.tianyi.sfzy1.domain.Companyinfo;
import com.tianyi.sfzy1.service.CompanyInfoService;
import com.tianyi.sfzy1.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/companyInfo")
public class CompanyInfoController {
    @Autowired
    private CompanyInfoService companyInfoService;
    @GetMapping("/getCompanyInfo")
    public R getCompanyInfo(){
        Companyinfo companyInfo = companyInfoService.selectAll();
        if(companyInfo==null){
            return R.error("公司信息不存在");
        }else{
            return R.ok(companyInfo);
        }
    }

}
